Link to web site from menu options.
authorrobertl <robertl>
Sun, 27 Jun 2010 21:12:37 +0000 (21:12 +0000)
committerrobertl <robertl>
Sun, 27 Jun 2010 21:12:37 +0000 (21:12 +0000)
gui/mainwindow.cpp
gui/mainwindow.h
gui/mainwinui.ui

index 14bbd1c3963ef9c4d38f14d9cb632704078bf88c..981337c568240a5657de0c87c5935df610a242c9 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.23 2010/06/21 03:45:10 robertl Exp $
+// $Id: mainwindow.cpp,v 1.24 2010/06/27 21:12:37 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -19,6 +19,7 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
 //  USA
 //
+#include <QDesktopServices>
 #include <QFileDialog>
 #include <QMessageBox>
 #include <QMimeData>
@@ -150,6 +151,8 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
   connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(closeActionX()));
   connect(ui.actionHelp, SIGNAL(triggered()), this, SLOT(helpActionX()));
   connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(aboutActionX()));
+  connect(ui.actionVisit_Website, SIGNAL(triggered()), this, SLOT(visitWebsiteActionX()));
+  connect(ui.actionMake_a_Donation, SIGNAL(triggered()), this, SLOT(donateActionX()));
   connect(ui.actionUpgradeCheck, SIGNAL(triggered()), this, SLOT(upgradeCheckActionX()));
   connect(ui.actionPreferences, SIGNAL(triggered()), this, SLOT(preferencesActionX()));
 
@@ -949,6 +952,17 @@ void MainWindow::closeEvent(QCloseEvent*)
   closeActionX();
 }
 
+//------------------------------------------------------------------------
+void MainWindow::donateActionX()
+{
+  QDesktopServices::openUrl(QString("http://www.gpsbabel.org/contribute.html?gbversion=" VERSION));
+}
+
+//------------------------------------------------------------------------
+void MainWindow::visitWebsiteActionX()
+{
+  QDesktopServices::openUrl(QString("http://www.gpsbabel.org"));
+}
 
 //------------------------------------------------------------------------
 void MainWindow::dragEnterEvent(QDragEnterEvent *event)
index 28ead83ffe0a8876bb89d1ee125e79c34b798d3f..4aa185cd3f616c55354f8b687a9f4a17a6b46274 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.h,v 1.11 2010/04/11 22:38:07 robertl Exp $
+// $Id: mainwindow.h,v 1.12 2010/06/27 21:12:37 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -96,6 +96,7 @@ protected:
   void browseInputFile();
   void browseOutputFile();
   void closeActionX();
+  void donateActionX();
   void dragEnterEvent(QDragEnterEvent *);
   void dropEvent(QDropEvent *event);
   void filtersClicked();
@@ -110,6 +111,7 @@ protected:
   void outputFormatChanged(int);
   void outputOptionButtonClicked();
   void preferencesActionX();
+  void visitWebsiteActionX();
   void resetFormatDefaults();
   void upgradeCheckActionX();
 
index 4f6e108aecb4e5455c827de3bc390752085fcf90..897fbdbaa820f14417b3e217eee7780ac7a82ff8 100644 (file)
     <addaction name="separator"/>
     <addaction name="actionAbout"/>
     <addaction name="actionUpgradeCheck"/>
+    <addaction name="separator"/>
+    <addaction name="actionVisit_Website"/>
+    <addaction name="actionMake_a_Donation"/>
    </widget>
    <addaction name="menuFile"/>
    <addaction name="menuHelp"/>
     <string>Check for Upgrade</string>
    </property>
   </action>
+  <action name="actionVisit_Website">
+   <property name="text">
+    <string>Visit Website...</string>
+   </property>
+  </action>
+  <action name="actionMake_a_Donation">
+   <property name="text">
+    <string>Make a Donation...</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="app.qrc"/>